Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
See #2431.
Loading a workbook with an icon set conditional formatting rule stored in
extLstthrew anInvalidOperationExceptionwhen a threshold usedtype="formula"with a numeric constant value.Cause
Icon sets using extended sets (
3Stars,3Triangles,5Boxes) or cross-sheet formulas are stored inextLstand read viaApplyIconSetExtValues. That reader routed any numeric value to theValuesetter without checking the cfvo type, and the setter rejectsValuewhenType == Formula. The regular icon set reader (ReadIcon) and the databar reader already had this guard.Fix
Added a
Type != Formulacheck inApplyIconSetExtValuesso formula thresholds are routed to theFormulaproperty, matching the other two readers. Also switched the numeric parse toInvariantCulture, consistent with the databar reader and correct for the invariant XML format.Tests
Added round-trip tests that build an icon set in code, save to a stream, and reload:
3Stars) with a numeric formula cfvo — reproduces the exception without the fix, passes with it.ReadIconpath against regression.Full conditional formatting regression suite passes.